package com.yj.cmp.sdk.fusioncompute.compute.task;

import com.yj.cmp.sdk.fusioncompute.compute.task.vo.TaskListVo;
import com.yj.cmp.sdk.fusioncompute.compute.task.vo.TaskVo;
import okhttp3.ResponseBody;
import org.springframework.stereotype.Service;
import retrofit2.Call;
import retrofit2.http.*;

import java.util.Map;

/**
 * @author Zhai
 * @date 2021/9/1 11:16
 */
@Service
public interface FcTaskService {

    @GET("tasks/{taskId}")
    Call<TaskVo> getTaskDetail(@HeaderMap Map<String, Object> headers, @Path("taskId") String taskId);

    @GET("tasks")
    Call<TaskListVo> getTaskList(@HeaderMap Map<String, Object> headers,
                                 @QueryMap Map<String, Integer> queryParam);

    @POST("tasks/{taskId}")
    Call<ResponseBody> cancelTask(@HeaderMap Map<String, Object> headers, @Path("taskId") String taskId);
}
